package Exception;

import java.awt.*;
import java.io.FileNotFoundException;
import java.io.IOException;

/**
 * 子类重写超类含有throws声明异常抛出的方法时，对throws的重写规则
 */
public class ThrowsDemo {
    public void dosome()throws IOException, AWTException {}
    class subClass extends ThrowsDemo {
        //允许不再抛出任何异常
//        public void dosome() {}
        //允许仅抛出部分异常
//        public void dosome() throws IOException{}
        //允许超类方法抛出异常的子类型异常
        public void dosome()throws FileNotFoundException{}
    }
}
